<?php

require('base.php');

class Portal extends Base {
	
	function Portal() {
		parent::Base();
		$this->database();
	}
	
	function index($language) {
		$this->language( $language, 'base' );
		
		$solution_list = $this->db->find("select * from solution where language='$language' limit 0, 10");
		$service_list = $this->db->find("select * from service where language='$language'");
		$news_list = $this->db->find("select * from article where language='$language' order by created desc limit 0,2");
		
		$page = $this->db->find_row("select * from page where language='$language' and url_pattern='index'");
		
		$meta = array(
			'title' 		=> $page['title'],
			'keywords'		=> $page['keywords'],
			'description'	=> $page['description']
		);
		
		$data = array(
			'solution_list' => $solution_list,
			'service_list' 	=> $service_list,
			'news_list' 	=> $news_list,
			'meta'			=> $meta	
		);
		
		$this->layout('portal/index', $data);
	}
}

?>